﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Enterprise.UI.Web.Modules.WebEmail
{
    public partial class OutBox : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindEmail();
            }
        }

        private void BindEmail()
        {
            Enterprise.Service.Email.EmailService es = new Service.Email.EmailService();
            string email = es.GetEmailAddressByUserId(Enterprise.Infrastructure.Utility.Get_UserId);
            System.Data.DataSet ds = es.getOutBox(email);
            GridView1.DataSource = ds;
            GridView1.DataBind();
        }

        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            e.Row.Cells[5].Visible = false;
            if(e.Row.RowType== DataControlRowType.DataRow)
            e.Row.Cells[4].Text = "<img src='/Styles/images/send_"+e.Row.Cells[4].Text+".png'/>";
            e.Row.Cells[6].Visible = false;
        }

        protected void btn_Delete_Click(object sender, EventArgs e)
        {

        }

        protected void btn_Send_Click(object sender, EventArgs e)
        {

        }
    }
}